﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL_HealthInsurance;

namespace HealthInsuranceMgm
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //List Policy
            BLLPolicies obj = new BLLPolicies();
            rptPolicy.DataSource = obj.ListPolicy();
            rptPolicy.DataBind();

            //List News
            BLLNews objNews = new BLLNews();
            rptNews.DataSource = objNews.Listnew();
            rptNews.DataBind();
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            if (ddlCate.SelectedIndex == 0)
            {
                Response.Redirect("SearchPolicy.aspx?key=" + txtSearch.Text);
            }
            if (ddlCate.SelectedIndex == 1)
            {
                Response.Redirect("SearchNews.aspx?key=" + txtSearch.Text);
            }
        }
    }
}